#!/usr/bin/python
# -*- coding: utf-8 -*-
# File: models.py
# Author: Tomás Vírseda
# License: GPL v3
# Description: Models for Vazaar

import os

import gobject
import gtk

import vazaarlib.ui.ViewManager as ViewManager
import vazaarlib.ui.ResourceManager as ResourceManager
from vazaarlib.utils import get_logger

class ModelManager():
    def __init__(self, gui):
        self.gui = gui
        self.log = get_logger("ActionMgr")

        self.gui.model['resources'] = {} # resources cache
        self.gui.model['icons'] = {} # icon cache
        self.gui.model['vm'] = ViewManager.ViewManager() # View Manager
        self.gui.model['rm'] = ResourceManager.ResourceManager() # Resource Manager
        self.gui.model['parent'] = None
        self.gui.model['current'] = None
        self.gui.model['current_store'] = None
        self.gui.model['current_view'] = {}
        self.gui.model['report'] = None # stats for current view

        self.gui.model['iconview'] = gtk.ListStore(
                gobject.TYPE_STRING,    # Identifier
                gobject.TYPE_STRING,    # Type
                gtk.gdk.Pixbuf,         # Preview
                gobject.TYPE_STRING,    # Description
        )

        self.gui.model['cmefilters'] = gtk.ListStore(
                gobject.TYPE_STRING,    # qname
                gobject.TYPE_STRING,    # name
                gobject.TYPE_STRING,    # Description
        )
